﻿@model Domain.NetworkService.EchoDescription
<br />
<br />
@using (Html.BeginForm("AddEchoTest", "Manage", FormMethod.Post, new { id = "EchoForm", @class = "visible" }))
{
    @Html.Hidden("devName", null, new { value = ViewBag.devName })
    @Html.Label("IP: ")
    @Html.TextBoxFor(m => m.HostNameOrIP, new
{
    type = "text",
    required = "required",
    pattern = @"((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$",
    oninvalid = "this.setCustomValidity('Необходим IP адрес, например 192.168.0.1')",
    oninput = "setCustomValidity('')"
})
                                 
    @Html.Label(" Timeout: ")
    @Html.TextBoxFor(m => m.Timeout, new
{
    type = "number",
    @Value = "10",
    min = "1",
    max = "3600",
    maxlength = "4",
    oninvalid = "this.setCustomValidity('От 1 до 3600 секунд')",
    oninput = "setCustomValidity('')"
})
                                 
    @Html.Label(" Size: ")
    @Html.TextBoxFor(m => m.Size, new
{
    type = "number",
    min = "1",
    max = "65000",
    maxlength = "5",
    @Value = "32",
    oninvalid = "this.setCustomValidity('От 1 до 65000 байт')",
    oninput = "setCustomValidity('')"
})
                                 
    @Html.Label(" DF: ")
    @Html.CheckBoxFor(m => m.DontFragment)
                                      
    @Html.Label(" Response Time: ")
    @Html.TextBoxFor(m => m.ResponseTime, new
{
    type = "number",
    min = "1000",
    max = "5000",
    maxlength = "4",
    @Value = "5000",
    oninvalid = "this.setCustomValidity('От 1000 до 5000 мс')",
    oninput = "setCustomValidity('')"
})
                                      
    @Html.Label(" TTL: ")
    @Html.TextBoxFor(m => m.Ttl, new
{
    type = "number",
    min = "1",
    max = "128",
    @Value = "128",
    maxlength = "3",
    oninvalid = "this.setCustomValidity('От 1 до 128 переходов')",
    oninput = "setCustomValidity('')"
})
    @Html.HiddenFor(m => m.Special, new { @Value = Stub.Absent })
    <input class="btn" type="submit" value="Добавить" />
}